import { createStore } from 'vuex'
import createPersistedState from 'vuex-persistedstate'
import cart from './modules/cart'
import category from './modules/category'
import user from './modules/user'

// 创建vuex仓库 并导出
export default createStore({
  // 分模块
  modules: {
    user, category, cart
  },
  // vuex的插件
  plugins: [
    createPersistedState({
      key: 'vrabbit-client-pc-store',
      paths: ['user', 'cart']
    })
  ]
})
